package com.gzq.factorymethod.exam90;

public class SimpleFactory {

	public static IProduct create(Class<?> c) {
		try {
			Object newInstance = c.newInstance();
			return (IProduct) newInstance;
		} catch (InstantiationException e) {
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			e.printStackTrace();
		}
		return null;
	}

}
